package com.cade.agriculturemall.widget;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.cade.agriculturemall.R;

import java.util.zip.Inflater;

/**
 * Created by Lobby on 2017/11/28.
 */

public class TitleIntentLayout extends RelativeLayout {
    private TextView tvTitle;
    private TextView tvMore;

    public TitleIntentLayout(Context context) {
        super(context);
    }

    public TitleIntentLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        setView();

    }

    public TitleIntentLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setView();
    }

    public void setView() {
        LayoutInflater.from(getContext()).inflate(R.layout.layout_title_intent, this);
        tvTitle = (TextView) findViewById(R.id.layout_intent_tv_title);
        tvMore = (TextView) findViewById(R.id.layout_intent_tv_more);
    }

    public void setText(String title, String more) {
        tvTitle.setText(title);
        tvMore.setText(more);
    }

    public String getValue() {

        String value = tvMore.getText().toString();
        return value;
    }
}
